package com.twu.biblioteca;

import java.io.IOException;
import java.io.PrintStream;
import java.util.HashMap;


public class BibliotecaMenu {
    HashMap<Integer, String> menu = new HashMap();
    PrintStream printStream;

    public BibliotecaMenu(PrintStream printStream, HashMap menu){
        this.printStream = printStream;
        this.menu = menu;
    }

    public void buildMenu(){
        menu.put(1,"View all books");
        menu.put(2,"Reserve a book");
        menu.put(3,"Check membership details");
        menu.put(4,"View movies");
        menu.put(5,"Quit");
    }

    void printMenu(){
        for(Object key : menu.keySet())
        {
            printStream.print(key);
            printStream.print(" " + menu.get(key) + "\n");
        }
    }

    boolean validateUserInput(int userInputValue) throws IOException {
        boolean isValid = menu.containsKey(userInputValue);
        return isValid;
    }
}
